file = "test_file/readme.txt"
# 1.打开文件
with open(file, mode="r", encoding="utf-8") as f:
    # 2.操作文件:读取
    text = f.readline()
    print(text,end="")

# 读取首行,如果需要取其他行,需要进行循环获取并判断
